package luogu;

import java.util.Scanner;

public class Main2241 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long m = sc.nextLong();


        // 计算所有矩形数量（包括正方形）
        long totalRectangles = (n * (n + 1) / 2) * (m * (m + 1) / 2);

        // 计算正方形数量
        long squares = 0;
        long min = Math.min(n, m);
        for (long i = 1; i <= min; i++) {
            squares += (n - i + 1) * (m - i + 1);
        }

        // 长方形数量 = 所有矩形数量 - 正方形数量
        long rectangles = totalRectangles - squares;

        System.out.println(squares + " " + rectangles);
    }
}
